/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dominio;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author ronan
 */
@Entity
@Table(name = "falta")
public class Falta implements Serializable{
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private int codigoFalta;
    @Column
    private int falta;
    @JoinColumn(name = "codigoAluno", referencedColumnName = "codigoAluno")
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private Aluno aluno;
    @JoinColumn(name = "codigoTurma", referencedColumnName = "codigoTurma")
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private Turma turma;

   
    public Falta() {
    }
    public int getFalta() {
        return falta;
    }

    /**
     * @param faltas the faltas to set
     */
    public void setFalta(int falta) {
        this.falta = falta;
    }

    /**
     * @return the codigoFalta
     */
    public int getCodigoFalta() {
        return codigoFalta;
    }

    /**
     * @param codigoFalta the codigoFalta to set
     */
    public void setCodigoFalta(int codigoFalta) {
        this.codigoFalta = codigoFalta;
    }

    /**
     * @return the aluno
     */
    public Aluno getAluno() {
        return aluno;
    }

    /**
     * @param aluno the aluno to set
     */
    public void setAluno(Aluno aluno) {
        this.aluno = aluno;
    }

    /**
     * @return the turma
     */
    public Turma getTurma() {
        return turma;
    }

    /**
     * @param turma the turma to set
     */
    public void setTurma(Turma turma) {
        this.turma = turma;
    }
    

    
  
}
